<?php if( $tree ): ?>
<select name='product[category_id]'>
    <option><?php echo __('choose') ?></option>
    <?php foreach( $tree as $tr ): ?>
        <option disabled="disabled" value='<?php echo $tr['obj']->getId()?>'<?php echo $tr['obj']->getId() == $product->getCategoryId() ? ' selected' : '' ?>><?php echo $tr['obj']->getName() ?></option>
        <?php if( !empty($tr['children']) ): ?>
            <?php foreach( $tr['children'] as $child ): ?>
                <option value='<?php echo $child['obj']->getObjId()?>'<?php echo $child['obj']->getObjId() == $product->getCategoryId() ? ' selected' : '' ?>><?php echo $child['obj']->getName() ?></option>
            <?php endforeach;?>
        <?php endif; ?>
    <?php endforeach; ?>
</select>
<?php endif; ?>
